<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<HTML>
		<HEAD>
		<link rel="stylesheet" type="text/css" href="" >
		<xsl:attribute name="href"><xsl:value-of select="ROOT/CSSHREF" /></xsl:attribute>
		</link>
		</HEAD>	
			<BODY topmargin="0" leftmargin="0">
				<div class="menu-body">
					<P>
						<ul>
							<xsl:apply-templates select="ROOT/TOPICLIST/TOPICS"
								mode="parentmode" />
						</ul>
					</P>
				</div>
			</BODY>
		</HTML>
	</xsl:template>

	<xsl:template match="TOPICS" mode="childrenmode">
		<LI CLASS="L21">
			<a ondrag="return false;" href="javascript:void(0)" hidefocus="true">
				<xsl:value-of select="URLT" />
					<xsl:if test="position()=last()">
						<span class="l-minus" node="last">　
							<span class="icon-open" node="icon">　
							</span>
							<xsl:value-of select="@TYPE" />
						</span>
					</xsl:if>
					<xsl:if test="not(position()=last())">
						<span class="t-minus">　
							<span class="icon-open" node="icon">　
							</span>
							<xsl:value-of select="@TYPE" />
						</span>
					</xsl:if>
			</a>
			<UL>
				<xsl:if test="not(position()=last())">
					<xsl:attribute name="class">collapsed-2</xsl:attribute>
				</xsl:if>
				<xsl:for-each select="TOPIC">
					<LI class="L3">
						<A ondrag="return false;" href="javascript:void(0)" hidefocus="true">
							<xsl:if test="position()=last()">
								<span class="line2">　
									<span class="icon-fn">　
									</span>
									<xsl:value-of select="TITLE" />
								</span>
							</xsl:if>
							<xsl:if test="not(position()=last())">
								<span class="line3">　
									<span class="icon-fn">　
									</span>
									<xsl:value-of select="TITLE" />
								</span>
							</xsl:if>
						</A>
					</LI>
				</xsl:for-each>
				<xsl:if test="TOPICS">
					<xsl:apply-templates select="TOPICS" mode="childrenmode" />
				</xsl:if>
			</UL>
		</LI>
	</xsl:template>

	<xsl:template match="TOPICS" mode="parentmode">
		<xsl:variable name="temp">
			<xsl:value-of select="@TYPE" />
		</xsl:variable>
		<LI CLASS="L1">
			<A ondrag="return false;" href="javascript:void(0)" hidefocus="true">
					<xsl:if test="position()=last()">
						<!--
							<img src="../images/menu/l_minus.gif" align="absMiddle"
							node="last" />
						-->
						<span class="l-minus" node="last">　
						<span class="icon-open" node="icon">　 </span>
						<xsl:value-of select="$temp" />
						</span>
						</xsl:if>
						<xsl:if test="not(position()=last())">
						<span class="t-minus">　
						<span class="icon-open" node="icon">　 </span>
						<!--　
						<span class="icon-open" node="icon"></span>
					　　--><xsl:value-of select="$temp" />
						</span>
					</xsl:if>
					<!--
						<img src="../images/menu/icon_open.gif" align="absMiddle"
						node="icon" />
					-->
			</A>

			<UL>
				<xsl:if test="not(position()=last())">
					<xsl:attribute name="class">collapsed-1</xsl:attribute>
				</xsl:if>
				<xsl:variable name="topicsNum" select="count(TOPICS)" />
				<xsl:for-each select="TOPIC">
					<LI class="L22">
						<A ondrag="return false;" href="javascript:void(0)" hidefocus="true">
							<xsl:if test="position()=last()">
								<xsl:if test="$topicsNum=0">
									<span class="line2">　
										<span class="icon-fn">　
										</span>
										<xsl:value-of select="TITLE" />
									</span>
								</xsl:if>
								<xsl:if test="$topicsNum!=0">
									<span class="line3">　
										<span class="icon-fn">　
										</span>
										<xsl:value-of select="TITLE" />
									</span>
								</xsl:if>
							</xsl:if>
							<xsl:if test="not(position()=last())">
								<span class="line3">　
									<span class="icon-fn">　
									</span>
									<xsl:value-of select="TITLE" />
								</span>
							</xsl:if>
						</A>
					</LI>
				</xsl:for-each>
				<xsl:if test="TOPICS">
					<xsl:apply-templates select="TOPICS" mode="childrenmode" />
				</xsl:if>
			</UL>
		</LI>
	</xsl:template>
</xsl:stylesheet>